<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/8/31
  Time: 17:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>S Hotel</title>
    <!-- Meta tag Keywords -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="UTF-8" />
    <meta name="keywords" content="Cloud Login Form Responsive Widget,Login form widgets, Sign up Web forms , Login signup Responsive web form,Flat Pricing table,Flat Drop downs,Registration Forms,News letter Forms,Elements"
    />
    <script src="../js/jquery-2.2.3.min.js"></script>
    <script>
        addEventListener("load", function () {
            setTimeout(hideURLbar, 0);
        }, false);

        function hideURLbar() {
            window.scrollTo(0, 1);
        }
        function login(){
            $.post("${pageContext.request.contextPath}/admin/login",{"username":$("#username").val(),"password":$("#password").val()},function (resultMsg) {
                var span = $("#loginError");
                if (resultMsg.flag){
                    location.href="${pageContext.request.contextPath}/jsp/home.jsp";
                }else{
                    span.css("color","red");
                    span.html(resultMsg.errorMsg);
                }
            })
        }
    </script>
    <!-- Meta tag Keywords -->

    <!-- css files -->
    <link rel="stylesheet" href="../css/style.css" type="text/css" media="all" />
    <!-- Style-CSS -->
    <link rel="stylesheet" href="../css/fontawesome-all.css">
    <!-- Font-Awesome-Icons-CSS -->
    <!-- //css files -->

    <!-- web-fonts -->
    <link href="//fonts.googleapis.com/css?family=Encode+Sans+Condensed:100,200,300,400,500,600,700,800,900&amp;subset=latin-ext,vietnamese"
          rel="stylesheet">
    <!-- //web-fonts -->
    <style>
        #loginError{
            text-align: center;
            color: red;
        }
    </style>
</head>
<body>
<!-- title -->
<h1>
    S 酒店
</h1>
<!-- //title -->

<!-- content -->
<div class="container">
    <div id="clouds">
        <div class="cloud x1"></div>
        <!-- Time for multiple clouds to dance around -->
        <div class="cloud x2"></div>
        <div class="cloud x3"></div>
        <div class="cloud x4"></div>
        <div class="cloud x5"></div>
    </div>
    <!-- content form -->
    <div class="sub-main-w3">
        <form action="javascript:login();" method="post">
            <div class="form-style-agile">
                <label>
                    <i class="fas fa-user"></i>
                    Username

                </label>
                <input placeholder="Username" id="username" name="username" type="text" required="" >
            </div>
            <div class="form-style-agile">
                <label>
                    <i class="fas fa-unlock-alt"></i>
                    Password

                </label>
                <input placeholder="Password" id="password" name="password" type="password" required="">
            </div>
            <div class="form-style-agile" id="loginError"></div>
            <input type="submit" value="Log In">
        </form>
    </div>
    <!-- //content form -->

</div>
<!-- //content -->

<!-- copyright -->
<div class="footer">
    <h2>&copy; 2019 Hotel Login Form. All rights reserved | Design by
        <a href="/jsp/superQ.jsp">SuperQ</a>
    </h2>
</div>
<!-- //copyright -->
</body>
</html>
